package com.nidu.demo.oauth2.executor.command;

import com.alibaba.cola.dto.Response;
import com.nidu.demo.oauth2.gateway.OAuth2RefreshTokenGateway;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.Set;

@Component
@RequiredArgsConstructor
public class OAuth2RefreshTokenDeleteCmdExe {

    private final OAuth2RefreshTokenGateway gateway;

    public Response execute(Long id) {
        gateway.deleteById(id);
        return Response.buildSuccess();
    }

    public Response execute(Set<Long> ids) {
        gateway.deleteByIds(ids);
        return Response.buildSuccess();
    }
}
